package com.tarena.utils;

import java.util.concurrent.CopyOnWriteArrayList;

//消息队列
public class ServerMessageQueue {
    private CopyOnWriteArrayList<String> msgQueue = new CopyOnWriteArrayList<>();
//    1.获取消息队列
    public CopyOnWriteArrayList<String> getMsgQueue() {
        return msgQueue;
    }
    /*
    2.将消息加入到队列*/
    public void addMsgToQUeue (String msg){
        msgQueue.add(msg);
    }
    /*3.清空消息队列*/
    public void clearMsgQueue(){
        msgQueue.clear();
    }
}
